<?php

include '../DB/dbConnection.php';

$result=array();

if ($_GET){
	
	$query="SELECT * FROM student WHERE id=".$_GET['id'];
	
	$stmt = $conn->prepare($query);
	$success = $stmt->execute();
	$stmt->bind_result($id,$roll_number,$name,$gender,$blood,$standard_id,$division_id,$height,$weight,$father_name,$father_qualification,$father_occupation,$mother_name,$mother_qualification,$mother_occupation,$guardian_name,$guardian_qualification,$guardian_occupation,$city,$village,$email,$district,$landline,$state,$cell_number,$address,$image,$passwd,$school_id);

	$tmp=array();
	
	while ($stmt->fetch())
	{
		$tmp['id']=$id;
		$tmp['roll_number']=$roll_number;
		$tmp['name']=$name;
		$tmp['gender']=$gender;
		$tmp['blood']=$blood;
		$tmp['standard_id']=$standard_id;
		$tmp['division_id']=$division_id;
		$tmp['height']=$height;
		$tmp['weight']=$weight;
		$tmp['father_name']=$father_name;
		$tmp['father_qualification']=$father_qualification;
		$tmp['father_occupation']=$father_occupation;
		$tmp['mother_name']=$mother_name;
		$tmp['mother_qualification']=$mother_qualification;
		$tmp['mother_occupation']=$mother_occupation;
		$tmp['guardian_name']=$guardian_name;
		$tmp['guardian_qualification']=$guardian_qualification;
		$tmp['guardian_occupation']=$guardian_occupation;
		$tmp['city']=$city;
		$tmp['village']=$village;
		$tmp['email']=$email;
		$tmp['district']=$district;
		$tmp['landline']=$landline;
		$tmp['state']=$state;
		$tmp['cell_number']=$cell_number;
		$tmp['address']=$address;
		$tmp['image']=$image;
		$tmp['passwd']=$passwd;
		$tmp['school_id']=$school_id;
	}

	$stmt->close();
	$conn->close();
		
	if($success)
	{
		$result['error']='false';
		$result['list']=$tmp;
	}
	else
		$result['error']='true';
}
else
{
	$result['error']='true';
}

echo json_encode($result);


?> 
